<template>
	<view>
		<view class="title">{{dataSource.title}}</view>
		<scroll-view class="content">
			<radio-group @change="change">
				<label class="radio" v-for="(item,index) in dataSource.options" :key="index">
				<radio :value="item.value" />{{item.name}}</label>
			</radio-group>
		</scroll-view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				
			}
		},
		props:{
			dataSource:{
				type:Object,
				default:function(){
					return {}
				}
			}
		},
		methods:{
			change(e){
				let arg = {
					type:this.dataSource.type,
					value:e.target.value
				}
				this.$emit('change',arg)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.title {
		font-size: 30upx;
		color: #333333;
		padding-top: 60upx;
		font-weight: 600;
	}
	
	.content {
		max-height: 400upx;
		background-color: #ffffff;
		box-shadow: 0px 4px 20px 0px rgba(153, 153, 153, 0.2);
		border-radius: 8px;
		border: solid 1px #f7f7f7;
		padding: 20upx 40upx;
		margin-top: 40upx;
	}
	
	.radio {
		font-size: 28upx;
		color: #333333;
		display: inline-block;
		width: 50%;
		padding: 20upx 20upx 0 0;
	}
</style>
